#include "Relay.h"

TCPSocket::TCPSocket()
    : m_fd( -1 )
{
}

TCPSocket::TCPSocket( int fd )
    : m_fd( fd )
{
}

TCPSocket::~TCPSocket()
{
}

int
TCPSocket::generateSocket( void )
{
    m_fd = socket(AF_INET, SOCK_STREAM, 0);

    return m_fd;
}

int
TCPSocket::bind( const SocketAddr& servaddr )
{
    struct sockaddr_in addr;

    bzero(&addr, sizeof(addr));
    addr.sin_addr.s_addr = htonl(INADDR_ANY);
    addr.sin_family      = AF_INET;
    addr.sin_port        = htons(SERV_PORT);
}
